package cn.jx.asc.user.service;

import cn.jx.asc.user.pojo.*;
import cn.jx.asc.user.vo.DataShow;
import cn.jx.asc.user.vo.nowDataShow;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 周国伟
 * @desc TODO
 * @date 2018/6/6 10:44
 * @describe
 */
@Service("userService")
public interface UserService {

    User findUserByname(String username);

    int addUser(User user);

    int updateUser(User user);

    List<Record> findData(DataShow dataShow);

    List<Region> selectAllByUserId(Integer userId);

    List<Group> selectAllGroupByUserId(Integer userId);

    List<Valve> selectAllValveByUserId(Integer userId);

    int addRegion(Region  region);

    int deleteRegionByRegionId(Integer regionId);

    int updateAreaName(Region region);

    List<Plan> findPlanListByUserId(Integer userId);

    List<nowDataShow> findNowData();

    List<Region> findRegionWithGroup();

    List<Valve> findValveData();

    int insertGroupSelective(Group group);

    Region selectRegionByPrimaryKey(Integer regionId);

    User selectUserByPrimaryKey(Integer userId);

    int insertGroup(Group group);

    Group findGroupByGroupId(Integer groupId);

    int updateGroup(Group group);

    int deleteGroup(Integer groupId);

    int insertSensor(Sensor sensor);

    int findLastGroupId();

    int deleteSensorByPrimaryKey(Integer sensorId);

    List<Group> findGroupListByRegionId(Integer regionId);

    int addValve(Valve valve);

    int deleteValveByValveId(Integer valveId);

    Plan findPlanByUserIdAndCropType(Integer userId ,String cropType);

    List<Time> findTimeListByPlanIdAndCycleId(Integer planId ,Integer cycleId);

    List<Valve> findValveData(String groupId);

    List<Group> findGroupAndValve();

    int updateValve(String valveId, String controlType, List<Group> groupList);

    int addControl(List<String> listStartTime, List<String> listStopTime, List<String> listIntervalDay, String valveId, List<Group> groupList);

    int addHumidity(String humidity, String groupId, List<Region> regionList);

    int updateValve_ration(String groupId, String controlType, List<Region> regionList);

    int insertHumidity(Humidity humidity);

    int updateStateByGroupId(Integer groupId);

    List<Valve> findValveByGroupId(Integer groupId);

    List<Time> findTimeListByPlanId(Integer planId);

    List<Group> findGroupListByUserId(Integer groupId);

    int insertControl(Control control);

    int updateValveByVaList(List<String> valvaIdList, String controlType, List<String> buttonvalList);

    int insertRecord(Record record);

    int updateValve(Valve valve);

    List<Record> findAndroidData(DataShow dataShow);
}
